package com.santoker.user.service.service.tp.wechat.request;

import com.google.common.collect.Maps;
import com.santoker.baseservice.annotation.HttpParameter;
import com.santoker.user.service.service.tp.wechat.config.WeChatAbstractApi;
import lombok.Builder;
import lombok.Data;

import java.util.Map;

@Data
@Builder
public class WeChatAppAccessTokenRequest extends WeChatAbstractApi {

    @HttpParameter
    private String code;

    public Map<String, Object> getParams() {
        Map<String, Object> params = Maps.newHashMap();
        params.put("appid", weChatConfig.appId());
        params.put("secret", weChatConfig.secret());
        params.put("grant_type", "authorization_code");
        params.put("code", code);
        return params;
    }

}
